package com.ncmmall.domain.business.distribution;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.ncmmall.domain.security.user.WebUser;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * 分销商提现记录
 *
 * @author likaikai
 * @date 2020-08-27 19:48:22
 */
@Entity
@Table(name = "distributor_withdraw_record")
@Access(AccessType.FIELD)
@Getter
@Setter
public class DistributorWithdrawRecord {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private long id;

    /**
     * 提现申请流水号
     */
    private String recordNo;

    /**
     * 分销商
     */
    @JsonIgnore
    @OneToOne
    private Distributor distributor;

    /**
     * 提现金额
     */
    private double withDrawMoney;

    /**
     * 银行名称
     */
    private String bankName;

    /**
     * 银行卡号
     */
    private String bankCardNo;

    /**
     * 银行省
     */
    private String bankProvince;

    /**
     * 银行城市
     */
    private String bankCity;

    /**
     * 银行支行
     */
    private String bankSubBranch;

    /**
     * 银行开户人
     */
    private String bankAccoutName;

    /**
     * 1、待支付
     * 2、支付中
     * 3、已拒绝
     * 4、已支付
     * 5、支付失败
     */
    private int status;

    /**
     * 提现方式
     * 1、微信
     * 2、银行卡
     */
    private int payType;

    /**
     * 审核备注
     */
    private String note;

    /**
     * 审核时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Timestamp checkTime;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Timestamp createTime;

    /**
     * 支付记录
     */
    @OneToOne
    @JsonIgnore
    private DistributorWithdrawPayRecord record;

    /**
     * 操作人
     */
    @OneToOne
    @JsonIgnore
    private WebUser operator;

    @Transient
    private Long bankCardId;
}
